<?php $this->load->view('common/default_header.php');?>

<div class="container">
	<div class="row">
		<?php $this->load->view('common/index_nav.php');?>
		<form method="post" accept-charset="utf-8" id="loginForm">
		  <div class="form-group">
		    <label for="phone">手机号码：</label>
		    <input type="text" name="phone" class="form-control" id="phone" placeholder="手机号码">
		  </div>
		  <div class="form-group">
		    <label for="password">密码：</label>
		    <input type="password" name="password" class="form-control" id="password" placeholder="密码">
		  </div>
		 
		  <a href="javascript:login()" class="btn btn-primary">登陆</a>
		</form>
	</div>
</div>

<?php $this->load->view('common/default_footer.php');?>

<script type="text/javascript">
function login(){
	$.ajax({
	   type: "POST",
	   url: "/login/handle",
	   dataType: 'json',
	   data: $("#loginForm").serialize(),
	   success: function(data){
	     	if(data.errno==0 ){
	    		$.post("/login/rync", {platform:data.data.platform,cooper:data.data.cooper,otp:data.data.otp,signmsg:data.data.signmsg,redirect:data.data.redirect},function(data){
					if(data.errno==0){
						location.href=data.data.redirect;
					}else{
						alert("登陆失败！");
					}
				}, "json");
	    	}else{
	    		alert(data.msg);
	    	}
	   }
	});
}
</script>

</body>


</html>